package com.hydra.auth.controller;

import com.hydra.auth.dto.SysMenuQueryDto;
import com.hydra.auth.dto.SysUserQueryDto;
import com.hydra.auth.dto.menu.SysMenuTreeNodeDto;
import com.hydra.auth.entity.SysMenu;
import com.hydra.auth.entity.SysUser;
import com.hydra.auth.mapper.SysMenuMapper;
import com.hydra.auth.mapper.SysUserMapper;
import com.hydra.auth.repository.SysMenuService;
import com.hydra.auth.repository.SysUserService;
import com.hydra.base.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 系统菜单的控制器
 * @Author Hydra
 * @Date 2023/12/21 17:42
 */
@Slf4j
@RequestMapping("/api/auth/menu/")
@RestController
public class SysMenuController extends BaseController<SysMenuQueryDto, SysMenu, SysMenuMapper, SysMenuService> {

    @Autowired
    public SysMenuController(SysMenuService repository){
        super.setRepository(repository);
    }

    @RequestMapping("/getUserMenu")
    public List<SysMenuTreeNodeDto> getUserMenu(){
        return this.repository.getUserMenu();
    }

}
